<?xml version="1.0" encoding="UTF-8"?>
<!--   
Copyright (c) 2011, The Chancellor, Masters and Scholars of the University of Oxford
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of University of Oxford nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
  -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://vreci/properties/1/" xmlns:properties="http://vreci/properties/1/">
  <xs:element name="Properties">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="properties:Item"/>
      </xs:sequence>
      <!-- Should this be used as a filter or as a set of property values? -->
      <xs:attribute name="filter" type="xs:boolean" use="optional" default="false"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Item">
    <xs:complexType mixed="true">
      <!-- The category is the 'group' into which the property should be placed -->
      <xs:attribute name="category" use="optional" default=""/>
      
      <!-- The title is the text displayed to the user -->
      <xs:attribute name="title" use="required"/>

      <!-- An optional description of the item -->
      <xs:attribute name="description" use="optional" default=""/>

      <!-- The reference tells us what the item means. For a DICOM tag we use the reference 'http://vreci/dicom#xxxxyyyy' there xxxxyyyy is the tag number of the DICOM element in lower case. -->
      <xs:attribute name="reference" use="required" type="xs:anyURI"/>
      
      <!-- We may wish to hide some properties from the user. For example metadata about the creation of the properties file. -->
      <xs:attribute name="hidden" type="xs:boolean" default="false"/>

      <!-- A semicolon separated list of choices e.g. 'Head;Colon;Left hand;Right eye;Brain, legs and hair'-->
      <xs:attribute name="choices" use="optional"/>

      <!-- If a choice is specified should only these values be available. -->
      <xs:attribute name="restricttochoices" use="optional" default="false"/>

      <!-- Use the value as an XPath over the input file to get the default data. 
           If the reference is a http://vreci/dicom#xxxxyyyy one then the xxxxyyyy is used to get the data.
      -->
      <xs:attribute name="usevalueasxpath" type="xs:boolean" use="optional" default="false"/>

      <!-- Use this to indicate that the field has been manually edited and should not be overriden by automated tools. 
           The SilverLight addind should set this value.
      -->
      <xs:attribute name="manuallyedited" type="xs:boolean" use="optional" default="false"/>
      
    </xs:complexType>
  </xs:element>
</xs:schema>
